package com.yanliang.serializer;

import com.alibaba.fastjson.JSON;

/**
 * @author yanliang
 * @date 5/23/20203:11 PM
 */
public class JSONSerializer implements Serializer {

	@Override
	public byte[] serialize(Object object) {
		return JSON.toJSONBytes(object);
	}

	@Override
	public <T> T deserialize(Class<T> clazz, byte[] bytes) {
		return JSON.parseObject(bytes, clazz);
	}
}
